home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group95b.txt
/
000106_icon-group-sender _Thu Jul 27 16:00:49 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-09-18
|
2KB
Received: by cheltenham.cs.arizona.edu; Thu, 27 Jul 1995 16:37:17 MST
Date: Thu, 27 Jul 1995 16:00:49 -0500
From: "Mark B. Emmer" <Mark.Emmer@internetmci.com>
Subject: Re: snobol4 question
To: "Le Baron O. Ferguson" <ferguson@math.ucr.edu>,
"icon-group@cs.arizona.edu" <icon-group@cs.arizona.edu>
Message-Id: <01HTDH9ZY0368WWAKM@MAILSRV1.PCY.MCI.NET>
X-Mailer: e-mailMCI v2.3
Content-Transfer-Encoding: 7BIT
Errors-To: icon-group-errors@cs.arizona.edu
-- [ From: Mark B. Emmer * EMC.Ver #2.3 ] --
> From: Le Baron O. Ferguson \ Internet: (ferguson@math.ucr.edu)
> To: icon-group@cs.arizona.edu \ Internet: (icon-group@cs.arizona.edu)
)
>
> Subject: snobol4 question
>
> My problem is that I am using snobol4 to send control codes (among other
> things) to a printer. I assign to the variable OUTPUT. The output of
the
> program is directed to the printer by /o=lpt2: on the command line. The
> problem is that the assignment to OUTPUT causes a newline to also be
sent. I
> can program around this but it is aukward. In PASCAL we have WRITELN and
> WRITE, and the latter does not append a newline automatically. In C,
printf
> simply does not send a newline unless you tell it to do so. Is there a
> corresponding mechanism in snobol4?
If you're using SNOBOL4+, use a channel number on the command line, and the
'b' (binary) option in an explicit output statement:
Command line:
snobol4 progname /3=lpt2:
Program statement:
output('out',3,'b')
That suppresses the automatic CR/LF.
This won't work if you're using Vanilla SNOBOL4. The 'b' option was
omitted. However, here's a cheat that will work with either system as long
as you are writing to a character device, like lpt2:
The old DOS end-of-file character control-Z will cause DOS to stop sending
any data that follows in the same write operation. CHAR(26) is control-Z.
So
OUTPUT = 'abc' CHAR(26)
writes the three characters 'abc' to the device, and does not output either
the control-Z or the carriage-return/line-feed that follow.
----------------------------------------------------------------
Mark Emmer
Catspaw, Inc. Voice: 719-539-3884
P.O. Box 1123 FAX: 719-539-4830
Salida, CO 81201 USA e-mail: Mark.Emmer@internetMCI.com
******************* NOTE NEW E-MAIL ADDRESS ************************